<template>
  <div>
    <div id="one"></div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      option: {
        title: {
          text: '本周系统使用统计'
        },
        tooltip: {},
        legend: {
          data: ['使用量'],
          right: 0
        },
        xAxis: {
          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周六"]
        },
        yAxis: {},
        series: [{
          name: '使用量',
          type: 'line',
          data: [13, 10, 8, 12, 15, 1, 3]
        }]
      }
    }
  },
  mounted () {
    this.drawLine()
  },
  methods: {
    drawLine () {
      var myChart = this.$echarts.init(document.getElementById('one'))
      window.onresize = myChart.resize
      myChart.setOption(this.option)
    }
  }
}
</script>
<style scoped>
#one {
  width: 100%;
  height: 350px;
}
</style>